package com.tianhui.consignortwofei.other.auth;

import com.tianhui.consignortwofei.mvp.model.enty.BusinessLicenseInfo;
import com.tianhui.consignortwofei.mvp.model.enty.ConsignorInfo;
import com.tianhui.consignortwofei.mvp.model.enty.authLicense.IdCardInfo;

/**
 * @author fgs
 * @date 2021/1/14
 * @description
 **/
public class AuthInfoProcess {

    /**
     * 身份证正面
     *
     * @param idCardInfo
     * @param consignorInfo
     * @return
     */
    public ConsignorInfo processIdCardFrontInfo(IdCardInfo idCardInfo, ConsignorInfo consignorInfo) {
        if (idCardInfo == null) return consignorInfo;
        consignorInfo.principalPerson = idCardInfo.name;
        consignorInfo.contacts = idCardInfo.name;
        consignorInfo.customercardid = idCardInfo.idNumber;
        return consignorInfo;
    }

    /**
     * 营业执照
     *
     * @param businessLicenseInfo
     * @param consignorInfo
     * @return
     */
    public ConsignorInfo processBusinessLicenseInfo(BusinessLicenseInfo businessLicenseInfo, ConsignorInfo consignorInfo) {
        if (businessLicenseInfo == null) return consignorInfo;
        consignorInfo.certOrgCode = businessLicenseInfo.socialCreditCode;
        consignorInfo.lcno = businessLicenseInfo.socialCreditCode;
        consignorInfo.slrq = businessLicenseInfo.startDate;
        consignorInfo.orderplacedetails = businessLicenseInfo.address;
        consignorInfo.jyfw = businessLicenseInfo.businessNature;
        consignorInfo.customername = businessLicenseInfo.unitName;
        consignorInfo.legalperson = businessLicenseInfo.legalPerson;
        consignorInfo.zczb = businessLicenseInfo.registeredCapital;
        consignorInfo.effective = businessLicenseInfo.endDate;
        return consignorInfo;
    }


}
